package com.fr.report.script.function;

import com.fr.report.script.Function;
import com.fr.report.script.Function.Type;
import com.fr.report.script.NormalFunction;
import com.fr.report.script.Primitive;

public class BITNOT extends NormalFunction
{
  public Object run(Object[] paramArrayOfObject)
  {
    if (paramArrayOfObject.length < 1)
      return Primitive.ERROR_NAME;
    Object localObject = paramArrayOfObject[0];
    if (localObject instanceof Integer)
    {
      int i = ((Integer)localObject).intValue();
      return new Integer(i ^ 0xFFFFFFFF);
    }
    return Primitive.ERROR_NAME;
  }

  public Function.Type getType()
  {
    return Function.LOGIC;
  }

  public String getCN()
  {
    return "BITNOT(int):将一个十进制整数进行二进制取反运算。\nint:需要进行转换的十进制数。\n示例：\nBITNOT(3)等于-4。\nBITNOT(12)等于-13。";
  }

  public String getEN()
  {
    return "";
  }
}